<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">
    <body>

        <ui:composition template="./UserTemplate.xhtml">


            <ui:define name="content">
                <center>
                    <h1><b>Account Register!</b></h1>
                    <p>&nbsp;</p>
                    <table width="604" height="413" border="0" cellpadding="0" cellspacing="0">

                        <tr>
                            <th width="114"><div align="left"><span>Account Id *</span></div></th>
                            <td width="328"><p:inputText id="accId" value="#{accountBean.ac.accountId}" required="true" requiredMessage="Account Id is not null">
                                    <f:ajax event="change" execute="accId" listener="#{accountBean.checkAccountId}"/>
                                    <f:validator validatorId="Validator.CheckValidator"/>
                                </p:inputText>
                                <h:outputText id="display" value="#{accountBean.mess}" style="font-size: smaller;font-weight: normal;color: red"/>
                                <h:messages for="accId" style="font-size: smaller;font-weight: normal;color: red"/>
                            </td>

                        </tr>

                        <tr>
                            <th><div align="left"><span>Account Name *</span></div></th>
                            <td><p:inputText  id="tfullname" value="#{accountBean.ac.accountName}" required="true" requiredMessage="Account Name is not null">
                                        <f:validator validatorId="Validator.StringValidator"/>
                                </p:inputText>
                                <h:messages for="tfullname" style="font-size: smaller;font-weight: normal;color: red"/>

                            </td>
                        </tr>
                        <tr>
                            <th height="98"><div align="left"><span>Amount *</span></div></th>
                            <td><p:inputText id="amount" value="#{accountBean.ac.amount}" required="true" requiredMessage="Amount is not null">
                                   <!-- <f:validator validatorId="Validator.CheckNumber"/>-->
                                </p:inputText>
                                <h:messages for="amount" style="font-size: smaller;font-weight: normal;color: red"/>

                            </td>
                        </tr>
                        <tr>
                            <th width="114"><div align="left"><span>Email *</span></div></th>
                            <td width="328"><p:inputText id="email" value="#{sessionScope['userEmail']}" disabled="true" >


                                </p:inputText>


                            </td>


                        </tr>

                        <tr>
                            <td></td>
                            <td>  <h:commandButton value="Login" action="LoginUser" actionListener="#{accountBean.registerAccount}" styleClass="submit-login" image="../resources/images/forms/form_submit.gif"/>
                            </td>

                        </tr>

                    </table>

                </center>
            </ui:define>



        </ui:composition>

    </body>
</html>